﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ElencoGallery.ascx.vb"
    Inherits="WebUserControls_ElencoGallery"  %>

<script type="text/javascript">
    dojo.addOnLoad(
          function () {

              AttachEvent();

          })

    function Redirect(evt) {
        var album
        var locale
        if (evt.target.id.indexOf("ImgAddress") >= 0) {
            var Id = evt.target.id.replace("ImgAddress", "LblAlbum")
            album = dojo.byId(Id).innerHTML;
            var IdLocale = evt.target.id.replace("ImgAddress", "LblLocale")
            locale = dojo.byId(IdLocale).innerHTML;
        }
        else {
            if (evt.target.id.indexOf("LblLocale") >= 0) {
                var Id = evt.target.id.replace("LblLocale", "LblAlbum")
                album = dojo.byId(Id).innerHTML;
                locale = evt.target.innerHTML;
            }
            else {
                album = evt.target.innerHTML;
                var IdLocale = evt.target.id.replace("LblAlbum", "LblLocale")
                locale = dojo.byId(IdLocale).innerHTML;
            }

        }

        album = album.replace(/ /gi, "_")
        locale = locale.replace(/ /gi, "_")
        window.open("Album-locale.aspx?Luogo=" + locale + "&Album=" + album)
    }

    function AttachEvent() {

        dojo.query("div[id*='ImgDiv']").forEach(function (tagElement) {
            dojo.connect(tagElement, "onclick", null, "Redirect");
        });
    }
</script>
<asp:Label ID="LblGallery" runat="server" Text="Ci spiace ma oggi non ci sono Gallery in evidenza :-("></asp:Label>
<div style="height: 20px">
    <asp:Label ID="LblFiltroLocale" runat="server" Text="Se vuoi puoi vedere solo le gallery dei locali che iniziano per:"></asp:Label>
</div>
<asp:LinkButton ID="LinkButton_A" runat="server">A</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_B" runat="server">B</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_C" runat="server">C</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_D" runat="server">D</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_E" runat="server">E</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_F" runat="server">F</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_G" runat="server">G</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_H" runat="server">H</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_I" runat="server">I</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_J" runat="server">J</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_K" runat="server">K</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_L" runat="server">L</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_M" runat="server">M</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_N" runat="server">N</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_O" runat="server">O</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_P" runat="server">P</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_Q" runat="server">Q</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_R" runat="server">R</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_S" runat="server">S</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_T" runat="server">T</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_U" runat="server">U</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_V" runat="server">V</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_W" runat="server">W</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_X" runat="server">X</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_Z" runat="server">Z</asp:LinkButton>&nbsp;
<asp:LinkButton ID="LinkButton_All" runat="server">TUTTI</asp:LinkButton>
<div style="height: 20px">
</div>
<div style="width: 780px; display:table-cell">
<asp:Repeater ID="RptAlbum" runat="server" >
    <ItemTemplate>
        <div id="ImgDiv" class="ImgPreviewGallery">
            <asp:Label ID="LblLocale" runat="server" CssClass="LocaleGallery" min-height="30px"
                Text='<%#DataBinder.Eval(Container.DataItem, "Locale")%>' Width="150px"></asp:Label>
            <asp:Image ID="ImgAddress" runat="server" ImageUrl='<%#DataBinder.Eval(Container.DataItem, "ImgAddress")%>'
                Width="150px" />
            <asp:Label ID="LblAlbum" runat="server" CssClass="Album" min-heigh="30px" Text='<%#DataBinder.Eval(Container.DataItem, "AlbumTitle")%>'
                Width="150px"></asp:Label>
        </div>
    </ItemTemplate>
</asp:Repeater>
</div>